home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / insertCurveToolScript.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.5 KB  |  123 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  14 January 1999
  22. // Author:         sw
  23. //
  24. //
  25. //  Procedure Name:
  26. //      insertCurveToolScript
  27. //
  28. //  Description:
  29. //    create wrapper around the insertCurve command
  30. //
  31. //  Input Arguments:
  32. //        0 ==> do the command.
  33. //        1 ==> show the action option box
  34. //        2 ==> return the command
  35. //        3 ==> show tool option box
  36. //        4 ==> enter the tool
  37. //
  38. //  Return Value:
  39. //      None.
  40. //
  41.  
  42. global proc insertCurveToolSetup( int $forceFactorySettings, string $goToTool )
  43. {
  44.     if( $forceFactorySettings || !`optionVar -ex insertCurveEuc` ) {
  45.         optionVar -iv insertCurveEuc 0;
  46.     }
  47.     if( $forceFactorySettings || !`optionVar -ex insertCurveLac` ) {
  48.         optionVar -iv insertCurveLac 1;
  49.     }
  50.     if( "" != $goToTool ) {
  51.         scriptCtx -e -euc `optionVar -q insertCurveEuc` $goToTool;
  52.         scriptCtx -e -lac `optionVar -q insertCurveLac` $goToTool;
  53.     }
  54. }
  55.  
  56. global proc insertCurveValues ( string $toolName ) 
  57. {
  58.     performInsertKnot 3 "Curve" $toolName;
  59.     scriptCtxCommonValues( $toolName );
  60. }
  61.  
  62. global proc insertCurveProperties()
  63. {
  64.     scriptCtxCommonProperties;
  65. }
  66.  
  67. proc createInsertCurveContext( string $tool )
  68. {
  69.     if( ! `scriptCtx -exists $tool` ) {
  70.         insertCurveToolSetup( 0, "" );
  71.         scriptCtx -i1 "insertKnot.xpm"
  72.             -title "Insert Knot Tool"
  73.             -bcn "insertCurve"
  74.  
  75.             -exitUponCompletion `optionVar -q insertCurveEuc`
  76.             -totalSelectionSets 1
  77.             -expandSelectionList true
  78.             -fcs ("insertCurveToolScript 0")
  79.  
  80.             -setNoSelectionPrompt ("Select points or edit points on NURBS " +
  81.                                    "curve(s) for inserting a knot.")
  82.             -setSelectionPrompt ("Select additional points or edit points " +
  83.                                  "on NURBS curve(s) or hit ENTER to " +
  84.                                  "insert knot(s).")
  85.  
  86.             -setAutoToggleSelection true
  87.             -setAutoComplete `optionVar -q insertCurveLac`
  88.             -showManipulators true
  89.             -setSelectionCount 0
  90.             -curveParameterPoint true
  91.             -editPoint true
  92.         $tool;
  93.     }
  94. }
  95.  
  96. global proc string performInsertKnotCrv( int $action,
  97.                                          string $goToTool )
  98. {
  99.     return performInsertKnot( $action, "Curve", $goToTool );
  100. }
  101.  
  102. global proc string insertCurveToolScript( int $setToTool )
  103. //
  104. //    Description :
  105. //        0 ==> do the command.
  106. //        1 ==> show the action option box
  107. //        2 ==> return the command
  108. //        3 ==> show tool/action option box
  109. //        4 ==> enter the tool/do the command
  110. {
  111.     string $tool = "";
  112.     if( $setToTool > 2 ) {
  113.         if( !`optionVar -q modelWithToolInsertCurve` ) {
  114.             $setToTool = 4 - $setToTool;
  115.         }
  116.         else {
  117.             $tool = "insertCurveContext";
  118.             createInsertCurveContext $tool;
  119.         }
  120.     }
  121.     return scriptToolScript( "performInsertKnotCrv", $setToTool, $tool );
  122. }
  123.